﻿<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>linux替换目录下文件内容</title>
</head>
<body>
<div id="wmd-preview" class="wmd-preview"><div class="md-section-divider"></div><div class="md-section-divider"></div><h1 data-anchor-id="favk" id="linux替换目录下文件内容">linux替换目录下文件内容</h1><hr><blockquote data-anchor-id="d1ag" class="white-blockquote">
  <p>源字符串（192.168.2.131）/新字符串（192.168.9.141）</p>
</blockquote><div class="md-section-divider"></div><pre class="prettyprint linenums prettyprinted" data-anchor-id="0mpt"><ol class="linenums"><li class="L0"><code><span class="pln">sed </span><span class="pun">-</span><span class="pln">i </span><span class="str">"s/192.168.2.131/192.168.9.141/g"</span><span class="pln"> </span><span class="str">`grep 192.168.2.131 -rl ./*`</span></code></li></ol></pre></div>
</body>
</html>